Data storage and data exchange is a core technology for a communications device, and a current data storage and exchange process is as follows.
The communications device receives data by using an input end, then stores the data into an on-chip or off-chip data buffer, and during forwarding, first reads the data from the buffer, and then exchanges the data to a target output end for data outputting.
In addition, data received by each data input end in a current communications device is buffered into a buffer corresponding to the data input end. For example, the communications device includes an input end 1, an input end 2, an input end 3, . . . , and an input end n, and buffers include a buffer 1, a buffer 2, a buffer 3, . . . , and a buffer n; in this case, data received by the input end 1 is stored into the buffer 1, data received by the input end 2 is stored into the buffer 2, data received by the input end 3 is stored into the buffer 3, and data received by the input end n is stored into the buffer n. However, in an actual application, different input ends may receive different amounts of data; in this case, different buffers store different amounts of data, that is, occupation amounts of data spaces of different buffers are different. For example, data spaces of some buffers are all occupied, and consequently data received by input ends corresponding to the buffers cannot be stored; or for some buffers, few data spaces are occupied, which causes low data space utilization of the buffers. It may be learned that buffer utilization of a current communications device is not high.